;;; typescript.cfg.el --- Summary
;;; Commentary:
;;; TypeScript configuration
;;; Code:

(require 'package.cfg)

(package-install-if-absent 'typescript-mode)
(use-package typescript-mode
  :mode
  (("\\.ts$" . typescript-mode)
   ("\\.tsx$" . typescript-mode))
  :interpreter ("node" . typescript-mode))

;; TypeScript Interactive Development Environment for Emacs
;; Needs node.js >= v0.12.0.
;; Make sure to add tsconfig.json in the project root folder.
(package-install-if-absent 'tide)
(use-package tide
  :config
  (add-hook 'typescript-mode-hook 'tide-setup)
  (add-hook 'typescript-mode-hook 'flycheck-mode)
  (add-hook 'typescript-mode-hook 'eldoc-mode)
  (add-hook 'typescript-mode-hook 'yas-minor-mode))

(provide 'typescript.cfg)
;;; typescript.cfg.el ends here
